#include "NetClient.h"

using namespace Hiranipra;
using namespace Hiranipra::Net;
//using namespace Hiranipra::Platform;

NetClient::NetClient()
{
}

NetClient::~NetClient()
{
}

bool NetClient::Connect( const Address& address, uint8 channelCount )
{
	_serverAddress = address;
	_selfHost = enet_host_create( NULL, 1, 0, 0 );
	ENetPeer* enetPeer = enet_host_connect( _selfHost, address.GetAddress(), channelCount );
	if( enetPeer == NULL )
		return false;

	_serverPeer = new Peer( enetPeer );
	enetPeer->data = _serverPeer;

	return true;
}

void NetClient::OnConnect( ENetEvent& ev )
{
}

void NetClient::OnDisconnect( ENetEvent& ev )
{
}
